<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:text-align="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="ThemeBucket">
  <link rel="shortcut icon" th:href="@{/#}" type="image/png">

  <title>编辑学生信息展示</title>

  <!--data table-->
  <link rel="stylesheet" th:href="@{/js/data-tables/DT_bootstrap.css}" />

    <!--公共css-->
    <link th:include="common::commonheader">
</head>

<body class="sticky-header">

<section>
    <!-- left side start-->
    <div th:replace="common::leftmenu"></div>
    <!-- left side end-->

    <!-- main content start-->
    <div class="main-content" >

        <!-- 头部分开始-->
        <div th:replace="common::headermenu"></div>
        <!-- header section end-->


        <!-- page heading start-->
        <div class="page-heading">
            <h3>
                可编辑学生页面
            </h3>
            <ul class="breadcrumb">
                <li>
                    <a href="#">Dashboard</a>
                </li>
                <li>
                    <a href="#">Data Table</a>
                </li>
                <li class="active"> 可编辑学生页面 </li>
            </ul>
        </div>
        <!-- page heading end-->

        <!--body wrapper start-->
        <div class="wrapper">
             <div class="row">
                <div class="col-sm-12">
                <section class="panel">
                <header class="panel-heading">
                    编辑学生表
                    <span class="tools pull-right">
                        <a href="javascript:;" class="fa fa-chevron-down"></a>
                        <a href="javascript:;" class="fa fa-times"></a>
                     </span>

                </header>
                <div class="panel-body">
                <div class="adv-table editable-table ">
                <div class="clearfix">
                    <div class="btn-group">
                        <a  th:href="@{/adminRole/toUpdateStu}" class="btn btn-primary">
                            Add New <i class="fa fa-plus"></i>
                        </a>
                    </div>
                    <div class="btn-group pull-right">
                        <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">Tools <i class="fa fa-angle-down"></i>
                        </button>
                        <ul class="dropdown-menu pull-right">
                            <li><a href="#">Print</a></li>
                            <li><a href="#">Save as PDF</a></li>
                            <li><a href="#">Export to Excel</a></li>
                        </ul>
                    </div>
                </div>
                <div class="space15"></div>
                <table class="table table-striped table-hover table-bordered" id="editable-sample">
                <thead>
                <tr>
                    <th>学号</th>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>电话</th>
                    <th>年级</th>
                    <th>Edit</th>
                    <th>Delete</th>
                </tr>
                </thead>
                <tbody>
                <tr class="" th:each="stu:${stus}">
                    <td th:text="${stu.getAccount()}"></td>
                    <td th:text="${stu.getName()}"></td>
                    <td th:text="${stu.getSex()}"></td>
                    <td th:text="${stu.getTel()}"></td>
                    <td th:switch="${stu.getStuGrade()}">
                        <span th:case="'1'">大一</span>
                        <span th:case="'2'">大二</span>
                        <span th:case="'3'">大三</span>
                        <span th:case="'4'">大四</span>
                    </td>
                    <td><a th:href="@{/adminRole/toeditStudent/{id}(id=${stu.getId()})}" class="btn btn-success" type="button">编辑</a></td>
                    <td><a th:href="@{/adminRole/deleteStudent/{id}(id=${stu.getId()})}" class="btn btn-danger" type="button">删除</a></td>
                </tr>

                </tbody>
                </table>
                </div>
                </div>
                </section>
                </div>
                </div>
            <div class="alert alert-success alert-block fade in" th:unless="${#strings.isEmpty(message)}">
                <button type="button" class="close close-sm" data-dismiss="alert">
                    <i class="fa fa-times"></i>
                </button>
                <h4>
                    <i class="icon-ok-sign"></i>
                    Success!
                </h4>
                <p th:text="${message}"></p>
            </div>
        </div>
        <!--body wrapper end-->

        <!--footer section start-->
        <footer>
            @Admin & editInfo
        </footer>
        <!--footer section end-->


    </div>
    <!-- main content end-->
</section>

<!-- Placed js at the end of the document so the pages load faster -->
<div th:replace="common::commonscript"/>
<!--data table-->
<script type="text/javascript" th:src="@{/js/data-tables/jquery.dataTables.js}"></script>
<script type="text/javascript" th:src="@{/js/data-tables/DT_bootstrap.js}"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>

<!--script for editable table-->
<script th:src="@{/js/editable-table.js}"></script>

<!-- END JAVASCRIPTS -->
<script>
    jQuery(document).ready(function() {
        EditableTable.init();
    });
    $(".message .close").on('click',function () {
        $(this).closest(".message")
            .transition("fade");
    })
</script>

</body>
</html>
